{extend name="public/base"/}
{block name="style"}
<style>
	#twoWindow {
		display: none;
	}
</style>
<link rel="stylesheet" href="/public/lboyue/css/newStyle.css">
<script src="/public/lboyue/js/book.js"></script>
<script src="/public/lboyue/js/libs/jquery.cookie.js"></script>
<script src="/public/lboyue/js/libs/jquerybase64.js"></script>
{/block}
{block name="body"}
{include file="public/header" /}
 <div class="bodySection">
            
    <div class="centerSection">

        <div class="navigationSection">
			当前位置：<a href="/">{:config('web_site_title')}</a> > <a href="/books/">书库</a> > <a href="{:url('/book/info',['id'=>$bookid])}">{$bookname}</a> > <a href="/book/chapter/{$bookid}.html">章节目录</a>

            <div class="navigationSection_right">
                <div class="colorBlock">
                    <span class="spanList">背景颜色：</span>
                    <span class="spanList colorBlock_list" id="selectColor">
                           <i class="color1"  bgColor="f4f7ef" fontColor="333" index="1"></i>
                           <i class="color2"  bgColor="fff7f7"  fontColor="333" index="2"></i>
                           <i class="color3"  bgColor="eff2f7" fontColor="333" index="3"></i>
                           <i class="color4"  bgColor="f7f4ef" fontColor="333" index="4"></i>
                           <i class="color5"  bgColor="4c4e52" fontColor="999" index="5"></i>
                       </span>
                </div>
                <div class="sizeBlock  marginLeft">
                    <span class="spanList">字号：</span>
                    <span class="spanList  sizeBlock_list" id="changeFontSize">
                           <i class="active" type="add">A+</i>
                           <i type="reduce">A-</i>
                           <input type="hidden" value="14"  id="fontSize" />
                       </span>
                </div>
            </div>
        </div>

        <div class="detailSection  detailPosition">

            <div class="settingWindow" id="settingWindow">
                <span class="bgColor1 lia" tempClass="ico1" id="goBackBtn"><i class="ico1"></i>回顶部</span>
                <span class="bgColor1 lia" tempClass="ico2"><a href="{:url('/book/info',['id'=>$bookid])}"> <i class="ico2"></i>书页</a></span>
                <span class="bgColor1 lia" tempClass="ico3"><a href="/book/chapter/{$bookid}.html"> <i class="ico3"></i>目录</a></span>

                <span class="bgColor1 lia" tempClass="ico4"><a {prev articleid="$bookid" chapterid="$chapterid" model="chapter" nodata="onclick='return nochapter(1,0);'"}id="pre" href="/chapter/read/{$bookid}/{$prev['id']}"{/prev}> <i class="ico4"></i>上一章</a></span>

                <span class="bgColor1 lia" tempClass="ico5"><a {next articleid="$bookid" chapterid="$chapterid" model="chapter" nodata="onclick='return nochapter(2,0);'"}id="next" href="/chapter/read/{$next.articleid}/{$next.id}"{/next}><i class="ico5"></i>下一章</a></span>
            </div>

            <div class="detailSection_contents"  id="contentBg">
                <h1 class="h1">{$chaptername}</h1>
                <div class="nav">
                    <span><i>作者：</i>{$author}</span>
                    <span><i>本章字数：</i>{$size}</span>
                    <span><i>阅读数：</i>{$allvisit}</span>
                    <span><i>创建时间：</i>{$update_time}</span>
                </div>
                                <div class="content cline"  id="content"></div>
                <!-- read setting start -->
                
                <!--setting end-->

                                                
                
                <div class="userSays_submit"><span class="button" id="userSays_button">
                    <!--<i></i>-->
                    打赏</span></div>

                <div class="rewardBlock" style="padding: 0; margin-top: 35px;display: none;"  id="rewardBlock">
                    <div class="rewardBlock_title">
                        <div class="h1" style="padding-top: 0px;">打赏</div>
                        <div class="nav" style="width: 890px;">
                            <ul>
                                <li class="active"><i></i>知音难求</li><li class="last"><i></i>小有名气</li><li class="last"><i></i>众望所归</li><li class="last"><i></i>名震四海</li><li class="last"><i></i>独孤求败</li>
                            </ul>
                        </div>
                    </div>

                    <div class="rewardBlock_cons" style="width: 1028px">
                        <div class="rewardBlock_consLeft" id="gift">
                            <div class="noDataText3">
                                你还没有打赏过作者呢, 现在就<br/>
                                去打赏作者助Ta提升名气吧～
                            </div>
                        </div>
                        <div class="rewardBlock_consRight" style="width: 687px; padding:0 30px 0 26px;">
                            <div class="rewardBlock_consRightBlock">
                                <ul>
									{volist name="bonusconfig" id="vo"}
                                    <li style="margin: 0 20px 0 15px;">
                                        <div class="rewardBlock_top">
											<div class="active"><i></i></div>
											<img src="{$vo.imgfile}" alt="">
										</div>
										<div class="rewardBlock_bottom">
											<span class="name" sendwords="{$vo.desc}">{$vo.caption}</span>
											<span class="money"><i>{$vo.price}</i>书币/艘</span>
										</div>
										<input type="hidden" class="giftid" value="{$vo.name}">
									</li>
									{/volist}
									</ul>
                            </div>

                            <div class="rewardBlock_addBlock">
                                <span class="span_li">数量：</span>
                                <span class="span_li reduce" id="reduce"></span>
                                <span class="span_li input"><input type="number" min="1" value="0"  id="productNum"/></span>
                                <span class="span_li add" id="add"></span>
                                <span class="span_li">共<i id="allMoney">0</i>书币</span>
                                <input type="hidden" value="0" id="moneyType">
                            </div>
                            <input type="hidden" id="giftid" value="">
                            <div class="rewardBlock_main">
                                <span class="title">赠言：</span>
                                <div class="rewardBlock_mainText">
                                    <textarea name="" id="message" cols="30" rows="10" placeholder="支持作者文思泉涌，妙笔生花"></textarea>
                                </div>
                                <div class="button" onclick="sendgift({$bookid})">打赏</div>
                            </div>

                        </div>

                    </div>

                </div>
                
                <div class="yuedu_page yuedu_page_bgColor1">
                    <ul>
                        <li>
                            <a {prev articleid="$bookid" chapterid="$chapterid" model="chapter" nodata="onclick='return nochapter(1,0);'"}id="pre" href="/chapter/read/{$bookid}/{$prev['id']}"{/prev}>上一章</a>
                                                    </li>
                        <li>
                            <a href="{:url('/book/info',['id'=>$bookid])}">书页</a>
                        </li>
                        <li>
                            <a href="/book/chapter/{$bookid}.html">目录</a>
                        </li>
                        <li>
                            <a {next articleid="$bookid" chapterid="$chapterid" model="chapter" nodata="onclick='return nochapter(2,0);'"}id="next" href="/chapter/read/{$next.articleid}/{$next.id}"{/next}>下一章</a>
                        </li>

                    </ul>
                </div>
            </div>

        </div>


    </div>
</div>
{block name="include"}{include file="public:footer" /}{/block}

{/block}

{block name="script"}
	<style type="text/css">
        .cline{line-height: 40px; font-size: 18px; text-indent: 36px;}
    </style>
	<script type="text/javascript" src="/public/lboyue/js/read.js"></script>
    <script type="text/javascript" src="/public/lboyue/js/pay.js"></script>
	 <script type="text/javascript">		
		
        $(document).ready(function () {

            paytype=1;
            paymoney=30;
            specialpaytype=1;
            bindchangecolor();
            bindchangefont();
            bindclosevote();
            bindgift();
            bindgotop();
            bindpay(100,'/book/100/32972/');
            bindpaybtn(2);
            $(window).resize(function () {
                bindsettingwindow();
            });

            selectGift();
            clickAdd();
            clickReduce();
            liactive("navpages", "books", "a", "");
            bindblurgift();
            var prevpage = $("#pre").attr("href");
            var nextpage = $("#next").attr("href");
            $("body").keydown(function (event) {
                if (event.keyCode == 37)
                {
                    var prechapterid= "0";
                    if (prechapterid == 0) {
                        nochapter(1 ,prechapterid);
                    } else {
                        window.location.href = prevpage;
                    }
                }
                //右键
                if (event.keyCode == 39)
                {
                    var nextchapterid = "33071";
                    if (nextchapterid <= 0) {
                        nochapter(2, nextchapterid);
                    } else {
                        window.location.href = nextpage;
                    }
                }
            });
            noctrlc();

            addbookshelf("{$bookid}", "{$chapterid}", 6, "{$Think.config.web_pc_url|str_replace="http://www","",###}");
            setuseragree();
        })
		
    </script>
	<script>
    $(document).ready(function () {
        bindnews();
        bindbookshelf();
        bindnav();

		var bookid = {$bookid};
		var total = {$sumbonus|default=0};
		$.ajax({
			url      : "/book/ajaxbonus",
			type     : "post",
			dataType : "json",
			data     :{'bookid':bookid},
			success  : function (res) {
				if (res.lists.length>0)
				{
					var resdata = res.lists;
					var html='';
					html += '<ul>';
					$.each(resdata, function(i, v) { 
						html += '<li>';
                        html += '<span class="left">'+v.authorname+'</span>';
                        html += '<span class="right">送了<i>'+v.num+'艘</i>'+v.actname+'</span>';
                        html += '</li>';
					})
                    html += '</ul>';
                    html += '<div class="rewardBlock_sbottom">累计打赏: '+total+'</div>';
					console.log(html);
                    $("#gift").html(html);
				}

			},
			error    : function () {
				malert("服务器开小差了～");
				return "";
			}
		});
    });
	</script>
	<script type="text/javascript">

		var readsetting=$.cookie('readsetting');
		
		if(readsetting==null||readsetting==undefined) {
			var fontsize=18;
			var background=1;
		} else {
			var settingarray=readsetting.split('_');
			if(settingarray.length==2)
			{
				background=settingarray[0]-1;
				fontsize=settingarray[1];
			}
		}
		
		var lineheight=Math.ceil(fontsize*2.22);
		var textindent=Math.ceil(fontsize*2.1);
		$('#selectColor  i').removeClass('active');
		$('#selectColor  i:eq('+background+')').addClass('active');
		$('#contentBg').css({'background-color': '#'+$('#selectColor  i:eq('+background+')').attr('bgColor'), 'color': '#'+$('#selectColor  i:eq('+background+')').attr('fontColor')});


		var background2=background+1;
		$('#userSays_block').removeAttr('class').addClass('userSays_block').addClass('bgColor'+background2);

		$('#settingWindow span').each(function (index, item) {
			$(item).removeAttr('class').addClass($(item).attr('tempClass')).addClass('bgColor'+background2);
			if(background == 4 && index > 0) {
				$("#settingWindow span a").css("color", "#999");
				$("#settingWindow span a").mouseover(function () {
					$(this).css("color", "red");
				});
				$("#settingWindow span a").mouseleave(function () {
					$(this).css("color", "#999");
				});
			}
		});
		var Cbox{$randomStr} = '{$chaptercontent|json_encode}';
		var html ='';		
		$.each(eval(Cbox{$randomStr}).reverse(), function(i, v) {
			html +=v;
		})
		$("#content").html(html);
		$('#content p').css({'fontSize': fontsize+"px"}).css({'line-height':lineheight+"px"}).css({'text-indent':textindent+"px"});
	</script>
{/block}